//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    /*用户信息数组*/
    imgArr: [],
    renderImgArr : [],

    targetItem:{
      transform : '' ,
      transitionDuration : '' 
    },
    /*元素位置*/
    site: {
      _x_start: 0,
      _y_start: 0,
      _x_move: 0,
      _y_move: 0,
      _x_end: 0,
      _y_end: 0,
      top_val: 0,
      left_val: 0
    },
    /*当前下标*/
    index: 0,
    /*是否允许动画*/
    run: true,
    /*是否加载完成*/
    load: false,
    /* 层级zindex */

  },
  
  onLoad: function () {
    this.setData({
      
    })
  },
  // 计算： 对 imgArr 的图进行 z-index 层级分割，margin-top,margin-left;
  computedImgsParams(){
    var len = imgArr.length 
    var offsetX = 10 
    var offsetY = 10 
    var _result = []
    _result.forEach( function(val, key){
      var obj = {
        zIndex : len -key ,
        marginTop : 10
      }
      
    } )
  },
  imgTouchStart(e){
    console.log(e)
    this.setData({
      _x_start : ev.touches[0].pageX ,
      _y_start : ev.touches[0].pageY
    })
  },
  imgTouchMove(e) {
    console.log(e)  
   // photoSwipe._x_move = ev.touches[0].pageX;
   // photoSwipe._y_move = ev.touches[0].pageY;
   
  },
  imgTouchEnd(e) {
    console.log(e)
  },
})
